package com.clstu.reader_;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class BufferedReader_ {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = null;
        bufferedReader = new BufferedReader(new FileReader("D:\\hello.java"));
        String buf = null;
        while ((buf=bufferedReader.readLine())!=null){
            System.out.println(buf);
        }
        bufferedReader.close();//这个方法在底层调用的时候就是调用的传进对象的close（）方法
    }
}
